﻿@model ENail.Portal.Web.Models.CustomerViewModel

@{
    ViewBag.Title = Model.Id == 0 ? "Add new customer" : "Update customer";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

    @using (Html.BeginForm())
    {
    <table>
        <tr>
            <td><input type="button" value="Save" onclick="document.forms(0).submit()" /></td>
            <td><input type="button" value="Discard" onclick="document.location='@Url.Action("List", "Customer")'" /></td>
            <td><input type="button" value="Delete" onclick="document.forms(1).submit()" style="visibility:@(Model.Id == 0 ? "hidden" : "visible")" /></td>
        </tr>
    </table>

    <table>
        <tr>
            <td>@Html.ValidationSummary()</td>
            <td></td>
        </tr>
        <tr>
            <td>Customer Id:</td>
            <td>@(Model.Id == 0 ? "-New-" : Model.Id.ToString())</td>
        </tr>
        <tr>
            <td>First Name:</td>
            <td>@Html.TextBoxFor(x => x.FirstName)</td>
        </tr>
        <tr>
            <td>Last Name:</td>
            <td>@Html.TextBoxFor(x => x.LastName)</td>
        </tr>
        <tr>
            <td>Title:</td>
            <td>@Html.TextBoxFor(x => x.Title)</td>
        </tr>
        <tr>
            <td>BirthDay:</td>
            <td>@Html.TextBoxFor(x => x.BirthDay)</td>
        </tr>
        <tr>
            <td>Address:</td>
            <td>@Html.TextBoxFor(x => x.Address)</td>
        </tr>
        <tr>
            <td>City:</td>
            <td>@Html.TextBoxFor(x => x.City)</td>
        </tr>
        <tr>
            <td>State:</td>
            <td>@Html.TextBoxFor(x => x.State)</td>
        </tr>
        <tr>
            <td>Zip:</td>
            <td>@Html.TextBoxFor(x => x.Zip)</td>
        </tr>
        <tr>
            <td>Country:</td>
            <td>@Html.TextBoxFor(x => x.Country)</td>
        </tr>
        <tr>
            <td>Phone:</td>
            <td>@Html.TextBoxFor(x => x.Phone)</td>
        </tr>
        <tr>
            <td>Mobile:</td>
            <td>@Html.TextBoxFor(x => x.Mobile)</td>
        </tr>
        <tr>
            <td>Email:</td>
            <td>@Html.TextBoxFor(x => x.Email)</td>
        </tr>
    </table>
    }

    @using (Html.BeginForm("Delete", "Customer", new { id = Model.Id }))
    {
    }
